// pages/spot/details.js
var dateTimePicker = require('../../utils/dateTimePicker.js');
Page({

    /**
     * 页面的初始数据
     */
    data: {
        swiperCurrent: 0,
        indicatorDots: true,
        autoplay: true,
        interval: 3000,
        duration: 800,
        searchVal: '',
        circular: true,
        indicatorCo: "#e4dcdc",
        indicatoraAC: "#4889db",
        imgUrls: [
            '../index/image/banner.jpg',
            '../index/image/banner.jpg',
            '../index/image/banner.jpg'
        ],
        goodsItem: [
            {
                text: '翠屏湖成人票',
                money: '99',
                time: '17:00'
            }, {
                text: '翠屏湖成人票',
                money: '99',
                time: '17:00'
            }, {
                text: '翠屏湖成人票',
                money: '99',
                time: '17:00'
            }, {
                text: '翠屏湖成人票',
                money: '99',
                time: '17:00'
            }
        ],
        evaluateType: [
            '全部 888',
            '好评 817',
            '有图 251',
            '差评 71'
        ],
        evaluateItem: [
            {
                portrait: '../index/image/picture.jpg',
                name: '木兮丶',
                type: '家庭套票',
                text: '还可以吧，还是值得一去的。'
            }, {
                portrait: '../index/image/picture.jpg',
                name: '木兮丶',
                type: '家庭套票',
                text: '还可以吧，还是值得一去的。'
            }
        ],
        itemList: [
            {
                picture: '../index/image/picture.jpg',
                name: '古田县景点名称',
                itemListType: [
                    {
                        type: '4.6评分'
                    }, {
                        type: '3A景区'
                    }
                ],
                distance: '6km',
                money: '99'
            }, {
                picture: '../index/image/picture.jpg',
                name: '古田县景点名称',
                itemListType: [
                    {
                        type: '4.6评分'
                    }
                ],
                distance: '6km',
                money: '99'
            }, {
                picture: '../index/image/picture.jpg',
                name: '古田县景点名称',
                itemListType: [
                    {
                        type: '4.6评分'
                    }, {
                        type: '3A景区'
                    }
                ],
                distance: '6km',
                money: '99'
            }
        ],
        active: '',
        status: '',
        date: '2018-10-01',
        date1: '2018-10-01',
        startYear: 2000,
        endYear: 2050
    },

    make: function () {
        wx.navigateTo({
            url: 'make'
        })
    },

    active: function (e) {
        console.log(e)
        this.setData({
            active: e.currentTarget.id
        })
    },

    explain: function () {
        this.setData({
            status: 1
        })
    },

    close: function () {
        this.setData({
            status: 2
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var obj = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
        var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
        // 精确到分的处理，将数组的秒去掉
        var lastArray = obj1.dateTimeArray.pop();
        var lastTime = obj1.dateTime.pop();

        this.setData({
            dateTime: obj.dateTime,
            dateTimeArray: obj.dateTimeArray,
            dateTimeArray1: obj1.dateTimeArray,
            dateTime1: obj1.dateTime
        });
    },

    changeDate(e) {
        this.setData({ date: e.detail.value });
    },

    changeDate1(e) {
        console.log(e)
        this.setData({ date1: e.detail.value });
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})
